#include <stdio.h>

struct student
{
    int stnum;
    char stname[20];
};

FILE *fp, *gp;

int main(int argc, char *argv[])
{
    struct student astu;
    if (argc < 2)
        return 0;
    else if (argc == 2)
    {
        fp = fopen(argv[1], "r");

        if (fp != NULL)
        {
            fscanf(fp, "%d\t%s\n", &astu.stnum, astu.stname);
            printf("%d\t%s\n", astu.stnum, astu.stname);
            return 1;
        }
        else
        {
            printf("Bad Path!\n");
            return -1;
        };
        fclose(fp);
    }
    else if (argc == 3)
    {
        fp = fopen(argv[1], "r");
        gp = fopen(argv[2], "w");
        if (fp != NULL && gp != NULL)
        {
            fscanf(fp, "%d\t%s\n", &astu.stnum, astu.stname);
            fprintf(gp, "%d\t%s\n", astu.stnum, astu.stname);
            return 0;
        }
        else{
            printf("Bad Path!\n");
        }
        fclose(fp);
        fclose(gp);
    }
}